﻿<local:BasePage
    x:Class="InTREPWP.Views.Embarques"
    xmlns:local="clr-namespace:InTREPWP.Views"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    d:DataContext="{d:DesignData ../SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    Style="{StaticResource TransitionPageStyle}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel x:Name="TitlePanel" Grid.Row="1" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="INTREP" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="embarques" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="2" Margin="12,0,12,0">
            <Grid>
                <TextBlock Text="Última Atualização" TextAlignment="Left" Style="{StaticResource PhoneTextSubtleStyle}"></TextBlock>
                <TextBlock x:Name="txtUltimaAtualizacao" Text="{Binding UltimaAtualizacao, StringFormat='dd/MM/yyyy hh:mm:ss'}" TextAlignment="Right" Style="{StaticResource PhoneTextAccentStyle}"></TextBlock>
            </Grid>
            <toolkit:PerformanceProgressBar x:Name="progressBar" IsIndeterminate="True" Visibility="Collapsed"/>
            <ListBox x:Name="MainListBox" Margin="0,25,-12,0" ItemsSource="{Binding}" SelectionChanged="MainListBox_SelectionChanged" DataContext="{Binding}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Id, StringFormat='00000'}" Width="100" Style="{StaticResource PhoneTextNormalStyle}"/>
                                <TextBlock Text="{Binding Produto}" TextWrapping="Wrap" Width="100" Style="{StaticResource PhoneTextNormalStyle}"/>
                                <TextBlock Text="{Binding Navio}" TextWrapping="Wrap" Width="155" Style="{StaticResource PhoneTextNormalStyle}"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding DataInicial, StringFormat='dd/MM/yyyy'}"  Width="100" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                <TextBlock Text="{Binding Destino}" TextWrapping="Wrap" Width="100" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                <TextBlock Text="{Binding Concluido}" Width="30" Style="{StaticResource PhoneTextSubtleStyle}"></TextBlock>
                                <TextBlock Text="%" Style="{StaticResource PhoneTextSubtleStyle}">
                                </TextBlock>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>

    <local:BasePage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.search.png" Text="buscar" Click="ApplicationBarSearch_Click"/>
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar.settings.png" Text="configurar"/>-->
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="sobre" Click="ApplicationBarMenuSobre_Click">
                </shell:ApplicationBarMenuItem>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </local:BasePage.ApplicationBar>
</local:BasePage>
